{% extends 'base.html' %}
{% include 'link_css.html' %}
{% block content %}

    <div class="well m-t">
        <strong>说明</strong>
        <p>
            仅支持CMDB中现有的Go服务，参数可自定义，比如：<i>spike service elastic</i>；<br>
            系统会从SVN拉取最新的 gotemplate 和 可执行文件，实际执行的命令会补全，比如：<i>/srv/spike/spike service elastic -c /srv/gotemplate/spike/conf.ctmpl</i>；<br>
            另外，命令中不允许包含 <i>;</i> <i> </i> <i>&&</i> <i> </i> <i>||</i> 等字符。
        </p>
    </div>

<div class="text-center">
<form  class="col-lg-12" action="{% url 'command_req' %}" method="post">
     <fieldset class="form-group">
        <label for="host_zone">区域</label>
        <select class="selectpicker form-control" data-live-search="true" id="host_zone" name="zone"  onchange="getoption(this.value)">
          <option></option>
          <option value="aws">aws/hsg</option>
          <option value="qcd">qcd</option>
        </select>
     </fieldset>

     <fieldset class="form-group">
        <label for="cmd">执行命令</label>
        <input type="text" class="form-control" id="cmd" name="command" required>
    </fieldset>

    <input  id="sub" class="btn btn-danger" type="submit" value="run" disabled>
</form>
</div>

<script>
    function getoption(val) {
        if (val) {
            $("#sub").attr("disabled", false)
        }
        else{
            $("#sub").attr("disabled", true)
        }
    }
</script>
{% endblock %}
